const filter = {
    moneyFormat: function (money) {
        if (money) {
            return "￥" + money.toFixed(2);
        } else {
            return "￥0.00";
        }
    },
    timeFormat: function (date) {
        let dt = new Date(date);
        let year = dt.getFullYear();
        let month = dt.getMonth().toString().padStart(2, "0");
        let day = dt.getDay().toString().padStart(2, "0");
        let hours = dt.getHours().toString().padStart(2, "0");
        let minutes = dt.getMinutes().toString().padStart(2, "0");
        let seconds = dt.getSeconds().toString().padStart(2, "0");
        let milliSeconds = dt.getMilliseconds().toString().padStart(3, "0");

        return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds + ":" + milliSeconds

    }

};


export default filter;